<mat-card class="db-card" >

  <mat-card-header>
    <h3>Data Stored in Conquest</h3>
  </mat-card-header>
  <mat-card-header>
    <mat-form-field>
      <mat-label>Table name</mat-label>
      <mat-select [formControl]="dicomControl" required (selectionChange)= "dataChange($event.value)">
        <mat-option>--</mat-option >
        <mat-option *ngFor="let dicom of dicoms" [value]="dicom">
          {{dicom.name}}
        </mat-option>
      </mat-select>
      <mat-error *ngIf="dicomControl.hasError('required')">Please choose a table to view</mat-error>
    </mat-form-field>
    <button mat-button class="refresh-btn" (click) = "refresh()"><mat-icon>refresh</mat-icon></button>
  </mat-card-header>
  


  <mat-card-content>
      <mat-form-field>
          <input matInput (keyup)="applyFilter($event.target.value)" placeholder="Search...">
        </mat-form-field>
        
        <div class="mat-elevation-z8">
          <table mat-table [dataSource]="dataSource" matSort>
        
            <!-- Dynamic columns -->
            <ng-container *ngFor="let col of displayedColumns; let colIndex = index">
              <ng-container [matColumnDef]="col">
                <th mat-header-cell *matHeaderCellDef mat-sort-header> {{col}} </th>
                <td mat-cell *matCellDef="let row"> {{row[col]}} </td>
              </ng-container>
            </ng-container>

            <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
            <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
          </table>
        
          <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator>
        </div>
        
  </mat-card-content>




  <mat-card-actions>
    <button mat-button color="primary" (click)="reInitialize()">Re-initialize Radiomics Tables</button>
    <button mat-button color="primary" (click)="onDeleteCalc()">Delete Calculation</button>
    <button mat-button color="primary" (click)="prioritySet('/priority-setter/')">Set ROI Priority</button>
  </mat-card-actions>



</mat-card>